const CracoLessPlugin = require('craco-less');
const CracoAlias = require("craco-alias");
const theme = require('./theme')
module.exports = {
  plugins: [
    {  //less 相关配置
      plugin: CracoLessPlugin,
      options: {
        lessLoaderOptions: {
          lessOptions: {
            modifyVars: theme,
            javascriptEnabled: true,
          },
        },
      },
    },
    {  //路径别名配置
      plugin: CracoAlias,
      options: {
        source: "options",
        baseUrl: "./",
        aliases: {
          "@": "./src"  //使用@代表src目录
        }
      }
    }
  ],
  devServer:{ //本地代理配置
    proxy:{
      '/smart':{
        target:'https://shopapi.smartisan.com',
        pathRewrite:{
          '^/smart':''
        },
        changeOrigin:true
      }
    }
  }
};
